package gameEngine.agents.distrebution;

import java.util.Random;

import org.apache.log4j.Logger;
import gameEngine.agents.distrebution.accessories.NormalDist;


/**
 * @author vladimir && alon 
 *
 */
public class Normal implements Distribution{

	Logger log = Logger.getLogger(this.getClass());
	
	double mean;
	double var;
	
	public Normal(double mean,double var){
		this.mean=mean;
		this.var=var;
	}
	
	public void setMean(double mean){
		this.mean=mean;
	}
	
	public double getMean() {
		
		return mean;
	}

	public double getVariance() {
		// TODO Auto-generated method stub
		return var;
	}

	public double generateValue() {
		Random rand=new Random();
		double value=rand.nextGaussian();
		value=value*var+mean;
		if(value>1)
			return 1;
		if (value<0)
			return 0;
		return value;			
	}
	
	public Normal clone(){
		return new Normal(mean, var);
	}
}
